﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default : System.Web.UI.Page
{
    protected int Num = 0;
    UserHelper u = new UserHelper();
    protected string Class = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        Literal title = Master.FindControl("title") as Literal;
        title.Text = "律师风采-宣汉知名律师-宣汉律师-秦锐";
        try
        {
            Num = Convert.ToInt32(Request.QueryString["ID"]);
            if (!IsPostBack)
            {
                AspNetPager1.RecordCount = u.GetAlbumListCount(Num);
                bind();
            }
        }
        catch
        {
            Response.Write("<script language='javascript'>window.location='../About/error.html'</script>");
            Num = 0;
        }
    }
    private void bind()
    {
        Repeater1.DataSource = u.GetAlbumList(Num,AspNetPager1.EndRecordIndex,AspNetPager1.StartRecordIndex);
        Repeater1.DataBind();
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        bind();
    }
    protected string GetClass()
    {
        switch(Num)
        {
            case 0:
                Class = "我的日常工作";
                break;
            case 1:
                Class = "我的证书";
                break;
            case 2:
                Class = "政府大院的树叶";
                break;
        }
        return Class;
    }
}